package net.xdclass.order.mapper;

import net.xdclass.common.enums.ProductOrderStateEnum;
import net.xdclass.order.model.ProductOrderDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yaya
 * @since 2023-12-31
 */
@Mapper
public interface ProductOrderMapper extends BaseMapper<ProductOrderDO> {

    /**
     * 更新订单状态
     * @param outTradeNo 订单号
     * @param toState    更新状态
     * @param fromState  当前状态
     * @return
     */
    int updateOrderState(@Param("outTradeNo") String outTradeNo, @Param("toState") ProductOrderStateEnum toState, @Param("fromState") ProductOrderStateEnum fromState);
}
